* Do with monthly frequency
import delimited "./data_py/processed/states_month.csv", clear

tsset month_id

arima gas L.gas
putexcel set "./models/first_stage/transitions_stata/transitions_price_month.xlsx", replace
matrix results = r(table)
putexcel A1 = matrix(results), names nformat(number_d2)

arima n_available_low L.gas L.n_available_low L.n_available_mid L.n_available_high
putexcel set "./models/first_stage/transitions_stata/transitions_low_month.xlsx", replace
matrix results = r(table)
putexcel A1 = matrix(results), names nformat(number_d2)

arima n_available_mid L.gas L.n_available_low L.n_available_mid L.n_available_high
putexcel set "./models/first_stage/transitions_stata/transitions_mid_month.xlsx", replace
matrix results = r(table)
putexcel A1 = matrix(results), names nformat(number_d2)

arima n_available_high L.gas L.n_available_low L.n_available_mid L.n_available_high
putexcel set "./models/first_stage/transitions_stata/transitions_high_month.xlsx", replace
matrix results = r(table)
putexcel A1 = matrix(results), names nformat(number_d2)


* Do with fortnightly frequency
import delimited "./data_py/processed/states_fortnight.csv", clear

tsset month_id

arima gas L.gas
putexcel set "./models/first_stage/transitions_stata/transitions_price_fortnight.xlsx", replace
matrix results = r(table)
putexcel A1 = matrix(results), names nformat(number_d2)

arima n_available_low L.gas L.n_available_low L.n_available_mid L.n_available_high
putexcel set "./models/first_stage/transitions_stata/transitions_low_fortnight.xlsx", replace
matrix results = r(table)
putexcel A1 = matrix(results), names nformat(number_d2)

arima n_available_mid L.gas L.n_available_low L.n_available_mid L.n_available_high
putexcel set "./models/first_stage/transitions_stata/transitions_mid_fortnight.xlsx", replace
matrix results = r(table)
putexcel A1 = matrix(results), names nformat(number_d2)

arima n_available_high L.gas L.n_available_low L.n_available_mid L.n_available_high
putexcel set "./models/first_stage/transitions_stata/transitions_high_fortnight.xlsx", replace
matrix results = r(table)
putexcel A1 = matrix(results), names nformat(number_d2)
